package think.c5;

public class Book {
    boolean checkOut = false;

    public Book(boolean checkOut) {
        this.checkOut = checkOut;
    }

    void checkIn() {
        checkOut = false;
    }


    @Override
    protected void finalize() throws Throwable {
        if (checkOut) {
            System.out.println("Error: check out");
        }
        //Normally, you'll also do this.
        //super.finalize();
        //Call the base-class version
    }
}
